<html>
<head><meta charset="utf-8"><title>points-to analysis for locals · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/points-to.20analysis.20for.20locals.html">points-to analysis for locals</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240585514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/points-to%20analysis%20for%20locals/near/240585514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hilmar Gústafsson <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/points-to.20analysis.20for.20locals.html#240585514">(May 28 2021 at 10:15)</a>:</h4>
<p>Do we have some way in MIR of getting a list of all the locals that a given local may be pointing to?<br>
I have the following example, where I want not only to tag <code>_3</code>, but also <code>_4</code> and <code>_1</code>.</p>
<div class="codehilite"><pre><span></span><code>    bb0: {
        _1 = const 0_i32;
        _4 = &amp;mut _1;
        _3 = &amp;mut (*_4);
        _2 = set_buffer(move _3) -&gt; bb1;
    }

    bb1: {
        _6 = _1;
        _5 = output(move _6) -&gt; bb2;
    }
</code></pre></div>
<p>I'm using a mir <code>Visitor</code> for this, and it may be that there's something there I'm missing that I might be able to use, it's just a bit hard to get a good overview of what's available.</p>



<a name="240605774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/points-to%20analysis%20for%20locals/near/240605774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hilmar Gústafsson <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/points-to.20analysis.20for.20locals.html#240605774">(May 28 2021 at 13:45)</a>:</h4>
<p>I ended up just adding a little state to keep track of this in the analysis myself, no need to respond. <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>